package com.codejiwei.core.rdd

import org.apache.spark.{SparkConf, SparkContext}

object Spark_Operator_Filter {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setMaster("local[1]").setAppName("Filter")
    val sc = new SparkContext(conf)
    val rdd = sc.makeRDD(List(1, 2, 3, 4, 5, 6), 2)
    val rdd1 = rdd.filter(num => num % 2 == 0)

    println(rdd1.collect().mkString(", "))

    sc.stop()
  }
}
